﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="PPARHistory.aspx.cs" Inherits="PPAP.Web.Part.PPARHistory" %>

<%@ Register TagPrefix="cc1" Namespace="PPAP.WebControls" Assembly="PPAP.WebControls" %>
<%@ Register Assembly="AspNetPager" Namespace="Wuqi.Webdiyer" TagPrefix="webdiyer" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
</head>
<body>
    <form id="Form1" runat="server">
    <div>
        <table width="800px" style="border-color: #2A48CE; border: 1px; border-style: solid;
            border-color: Gray; border-spacing: 0px;">
            <tr style="height: 32px;">
                <td style="font-weight: bold;" bgcolor="#D7D7D7" colspan="4">
                    PPAR History Filter SET
                </td>
            </tr>
            <tr>
                <td>
                    Part.No:
                </td>
                <td>
                    <cc1:PartNo ID="txtPartno" Width="200px" runat="server" />
                </td>
                <td>
                    Part.Name:
                </td>
                <td>
                    <asp:TextBox ID="txtPartName" runat="server"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td>
                    Plant:
                </td>
                <td>
                    <asp:DropDownList ID="ddlPlant" runat="server" Width="155px">
                    </asp:DropDownList>
                </td>
                <td>
                    Status:
                </td>
                <td>
                    <asp:DropDownList ID="ddlStatus" runat="server" Width="155px">
                    </asp:DropDownList>
                </td>
            </tr>
            <tr>
                <td>
                    Version:
                </td>
                <td>
                    <asp:TextBox ID="tbVersion" runat="server"></asp:TextBox>
                </td>
                <td>
                    Start Date:
                </td>
                <td>
                    <cc1:My97 ID="DatePicker1" runat="server"></cc1:My97>
                    to:<cc1:My97 ID="DatePicker2" runat="server"></cc1:My97>
                </td>
            </tr>
            <tr><td>Color:</td><td>
                <asp:TextBox ID="txtColor" runat="server"></asp:TextBox>
                </td><td>Result</td><td>
                <asp:TextBox ID="txtResult" runat="server"></asp:TextBox>
                </td></tr>
            <tr>
                <td align="center" colspan="4">
                    <asp:CheckBox ID="cbAll" runat="server" Text="All versions" Visible="False" />
                </td>
            </tr>
            <tr>
             <td align="left" colspan="2">
                    &nbsp;</td>
                <td align="center">
                    &nbsp;
                </td>
                <td align="right" style=" padding-right:30px;" >
                    <asp:Button ID="btnSubmit" CssClass="button" runat="server" Text="Search" OnClick="btnSubmit_Click" />
                    &nbsp;
                    <asp:Button ID="btnExport" CssClass="button" runat="server" Text="Export" OnClick="btnExport_Click" />
                </td>
            </tr>
        </table>
        <br />
        <br />
        <asp:DataGrid ID="dgList" HeaderStyle-BackColor="#2E8AC5" HeaderStyle-Font-Bold="true"
            HeaderStyle-Height="32px" Width="100%" OnLoad="dgLoad" AutoGenerateColumns="False"
            runat="server">
            <Columns>
                <asp:BoundColumn DataField="rownum" HeaderText="SN">
                    <ItemStyle HorizontalAlign="Center"></ItemStyle>
                </asp:BoundColumn>
                <asp:BoundColumn DataField="bdntpartno" HeaderText="Part number">
                    <ItemStyle HorizontalAlign="Center"></ItemStyle>
                </asp:BoundColumn>
                <asp:BoundColumn DataField="bdntpartname" HeaderText="Part name">
                    <ItemStyle HorizontalAlign="Center"></ItemStyle>
                </asp:BoundColumn>
                <asp:BoundColumn DataField="color" HeaderText="Color">
                    <ItemStyle HorizontalAlign="Center"></ItemStyle>
                </asp:BoundColumn>
                <asp:BoundColumn DataField="pparno" HeaderText="PPAR">
                    <ItemStyle HorizontalAlign="Center"></ItemStyle>
                </asp:BoundColumn>
                <asp:BoundColumn DataField="PPARVERSION" HeaderText="PPAR version">
                    <ItemStyle HorizontalAlign="Center"></ItemStyle>
                </asp:BoundColumn>
                <asp:BoundColumn DataField="qlevel" HeaderText="Q-level">
                    <ItemStyle HorizontalAlign="Center"></ItemStyle>
                </asp:BoundColumn>
                <asp:TemplateColumn HeaderText="Status">
                    <ItemStyle HorizontalAlign="Center"></ItemStyle>
                    <ItemTemplate>
                        <asp:Label ID="Label1" runat="server" Text='<%# ShowAuditStatus(Eval("status").ToString()) %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateColumn>
                <asp:TemplateColumn HeaderText="Status">
                    <ItemStyle HorizontalAlign="Center"></ItemStyle>
                    <ItemTemplate>
                        <asp:Label ID="Label2" runat="server" Text='<%# ShowAuditStatus2(Eval("status").ToString()) %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateColumn>
                <asp:TemplateColumn  HeaderText="Start date">
                    <ItemStyle HorizontalAlign="Center"></ItemStyle>
                    <ItemTemplate>
                    <asp:Label ID="lbppardate" runat="server" Text='<%#Eval("ppardate").ToString()==""?"":DateTime.Parse(Eval("ppardate").ToString()).ToString("yyyy-MM-dd")  %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateColumn>
                <asp:TemplateColumn  HeaderText="End date">
                    <ItemStyle HorizontalAlign="Center"></ItemStyle>
                    <ItemTemplate>
                    <asp:Label ID="lbendtime" runat="server"  Text='<%#Eval("endtime").ToString()==""?"":DateTime.Parse(Eval("endtime").ToString()).ToString("yyyy-MM-dd")  %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateColumn>
                <asp:BoundColumn DataField="FINALRESULT" HeaderText="Result">
                    <ItemStyle HorizontalAlign="Center"></ItemStyle>
                </asp:BoundColumn>
                <asp:BoundColumn DataField="qeuser" HeaderText="BDNT Q-engineer">
                    <ItemStyle HorizontalAlign="Center"></ItemStyle>
                </asp:BoundColumn>
                <asp:TemplateColumn ItemStyle-HorizontalAlign="Center" HeaderText="View">
                    <ItemTemplate>
                        <asp:ImageButton ID="ImageButton1" CssClass="tt" ToolTip='view' PostBackUrl='<%# "SupplierPPARWeb.aspx?rid="+Eval("ID")+"&his=1" %>'
                            ImageUrl='../Images/newimg/see.png' runat="server" />
                    </ItemTemplate>
                </asp:TemplateColumn>
                <asp:TemplateColumn ItemStyle-HorizontalAlign="Center" HeaderText="View">
                    <ItemTemplate>
                        <asp:ImageButton ID="ImageButton2" CssClass="tt" ToolTip='view' PostBackUrl='<%# "CreatPPARWeb.aspx?rid="+Eval("ID")+"&his=1" %>'
                            ImageUrl='../Images/newimg/see.png' runat="server" />
                    </ItemTemplate>
                </asp:TemplateColumn>
            </Columns>
            <HeaderStyle BackColor="#E7E8E8" Font-Bold="True" Height="32px"></HeaderStyle>
        </asp:DataGrid>
        <webdiyer:AspNetPager ID="AspNetPager2" runat="server" Width="100%" ShowPageIndexBox="Always" CssClass="paginator"
            PageIndexBoxType="DropDownList" TextBeforePageIndexBox="goto" HorizontalAlign="Center"
            PageSize="20" EnableTheming="true" AlwaysShow="True" FirstPageText="|&lt;" LastPageText="&gt;|"
            NextPageText="&gt;" PrevPageText="&lt;" SubmitButtonText="Go" TextAfterPageIndexBox="page"
            InvalidPageIndexErrorMessage="Page index is not effective numerical！" OnPageChanged="AspNetPager2_PageChanged"
            PageIndexOutOfRangeErrorMessage="Page index beyond range" BackColor="#E7E8E8">
        </webdiyer:AspNetPager>
    </div>
    </form>
</body>
</html>
